home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / tf.vim < prev    next >
Encoding:
Text File  |  2001-05-11  |  7.1 KB  |  210 lines

  1. " Vim syntax file
  2. " Language:    tf
  3. " Maintainer:    Lutz Eymers <ixtab@polzin.com>
  4. " URL:        http://www.isp.de/data/tf.vim
  5. " Email:    send syntax_vim.tgz
  6. " Last Change:    2001 May 10
  7. "
  8. " Options    lite_minlines = x     to sync at least x lines backwards
  9.  
  10. " Remove any old syntax stuff hanging around
  11.  
  12. " For version 5.x: Clear all syntax items
  13. " For version 6.x: Quit when a syntax file was already loaded
  14. if version < 600
  15.   syntax clear
  16. elseif exists("b:current_syntax")
  17.   finish
  18. endif
  19.  
  20. syn case match
  21.  
  22. if !exists("main_syntax")
  23.   let main_syntax = 'tf'
  24. endif
  25.  
  26. " Special global variables
  27. syn keyword tfVar  HOME LANG MAIL SHELL TERM TFHELP TFLIBDIR TFLIBRARY TZ  contained
  28. syn keyword tfVar  background backslash  contained
  29. syn keyword tfVar  bamf bg_output borg clearfull cleardone clock connect  contained
  30. syn keyword tfVar  emulation end_color gag gethostbyname gpri hook hilite  contained
  31. syn keyword tfVar  hiliteattr histsize hpri insert isize istrip kecho  contained
  32. syn keyword tfVar  kprefix login lp lpquote maildelay matching max_iter  contained
  33. syn keyword tfVar  max_recur mecho more mprefix oldslash promt_sec  contained
  34. syn keyword tfVar  prompt_usec proxy_host proxy_port ptime qecho qprefix  contained
  35. syn keyword tfVar  quite quitdone redef refreshtime scroll shpause snarf sockmload  contained
  36. syn keyword tfVar  start_color tabsize telopt sub time_format visual  contained
  37. syn keyword tfVar  watch_dog watchname wordpunct wrap wraplog wrapsize  contained
  38. syn keyword tfVar  wrapspace  contained
  39.  
  40. " Worldvar
  41. syn keyword tfWorld  world_name world_character world_password world_host contained
  42. syn keyword tfWorld  world_port world_mfile world_type contained
  43.  
  44. " Number
  45. syn match tfNumber  "-\=\<\d\+\>"
  46.  
  47. " Float
  48. syn match tfFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>"
  49.  
  50. " Operator
  51. syn match tfOperator  "[-+=?:&|!]"
  52. syn match tfOperator  "/[^*~@]"he=e-1
  53. syn match tfOperator  ":="
  54. syn match tfOperator  "[^/%]\*"hs=s+1
  55. syn match tfOperator  "$\+[([{]"he=e-1,me=e-1
  56. syn match tfOperator  "\^\[\+"he=s+1 contains=tfSpecialCharEsc
  57.  
  58. " Relational
  59. syn match tfRelation  "&&"
  60. syn match tfRelation  "||"
  61. syn match tfRelation  "[<>/!=]="
  62. syn match tfRelation  "[<>]"
  63. syn match tfRelation  "[!=]\~"
  64. syn match tfRelation  "[=!]/"
  65.  
  66.  
  67. " Readonly Var
  68. syn match tfReadonly  "[#*]" contained
  69. syn match tfReadonly  "\<-\=L\=\d\{-}\>" contained
  70. syn match tfReadonly  "\<P\(\d\+\|R\|L\)\>" contained
  71. syn match tfReadonly  "\<R\>" contained
  72.  
  73. " Identifier
  74. syn match tfIdentifier "%\+[a-zA-Z_#*-0-9]\w*" contains=tfVar,tfReadonly
  75. syn match tfIdentifier "%\+[{]"he=e-1,me=e-1
  76. syn match tfIdentifier "\$\+{[a-zA-Z_#*-0-9]\w*}" contains=tfWorld
  77.  
  78. " Function names
  79. syn keyword tfFunctions  ascii char columns echo filename ftime fwrite getopts
  80. syn keyword tfFunctions  getpid idle kbdel kbgoto kbhead kblen kbmatch kbpoint
  81. syn keyword tfFunctions  kbtail kbwordleft kbwordright keycode lines mod
  82. syn keyword tfFunctions  moresize pad rand read regmatch send strcat strchr
  83. syn keyword tfFunctions  strcmp strlen strncmp strrchr strrep strstr substr
  84. syn keyword tfFunctions  systype time tolower toupper
  85.  
  86. syn keyword tfStatement  addworld bamf beep bind break cat changes connect  contained
  87. syn keyword tfStatement  dc def dokey echo edit escape eval export expr fg for  contained
  88. syn keyword tfStatement  gag getfile grab help hilite histsize hook if input  contained
  89. syn keyword tfStatement  kill lcd let list listsockets listworlds load  contained
  90. syn keyword tfStatement  localecho log nohilite not partial paste ps purge  contained
  91. syn keyword tfStatement  purgeworld putfile quit quote recall recordline save  contained
  92. syn keyword tfStatement  saveworld send sh shift sub substitute  contained
  93. syn keyword tfStatement  suspend telnet test time toggle trig trigger unbind  contained
  94. syn keyword tfStatement  undef undefn undeft unhook  untrig unworld  contained
  95. syn keyword tfStatement  version watchdog watchname while world  contained
  96.  
  97. " Hooks
  98. syn keyword tfHook  ACTIVITY BACKGROUND BAMF CONFAIL CONFLICT CONNECT DISCONNECT
  99. syn keyword tfHook  KILL LOAD LOADFAIL LOG LOGIN MAIL MORE PENDING PENDING
  100. syn keyword tfHook  PROCESS PROMPT PROXY REDEF RESIZE RESUME SEND SHADOW SHELL
  101. syn keyword tfHook  SIGHUP SIGTERM SIGUSR1 SIGUSR2 WORLD
  102.  
  103. " Conditional
  104. syn keyword tfConditional  if endif then else elseif  contained
  105.  
  106. " Repeat
  107. syn keyword tfRepeat  while do done repeat for  contained
  108.  
  109. " Statement
  110. syn keyword tfStatement  break quit contained
  111.  
  112. " Include
  113. syn keyword  tfInclude require load save loaded contained
  114.  
  115. " Define
  116. syn keyword  tfDefine bind unbind def undef undefn undefn purge hook unhook trig untrig  contained
  117. syn keyword  tfDefine set unset setenv  contained
  118.  
  119. " Todo
  120. syn keyword  tfTodo TODO Todo todo  contained
  121.  
  122. " SpecialChar
  123. syn match tfSpecialChar "\\[abcfnrtyv\\]" contained
  124. syn match tfSpecialChar "\\\d\{3}" contained contains=tfOctalError
  125. syn match tfSpecialChar "\\x[0-9a-fA-F]\{2}" contained
  126. syn match tfSpecialCharEsc "\[\+" contained
  127.  
  128. syn match tfOctalError "[89]" contained
  129.  
  130. " Comment
  131. syn region tfComment        start="^;" end="$"  contains=tfTodo
  132.  
  133. " String
  134. syn region tfString   oneline matchgroup=None start=+'+  skip=+\\\\\|\\'+  end=+'+ contains=tfIdentifier,tfSpecialChar,tfEscape
  135. syn region tfString   matchgroup=None start=+"+  skip=+\\\\\|\\"+  end=+"+ contains=tfIdentifier,tfSpecialChar,tfEscape
  136.  
  137. syn match tfParentError "[)}\]]"
  138.  
  139. " Parents
  140. syn region tfParent matchgroup=Delimiter start="(" end=")" contains=ALLBUT,tfReadonly
  141. syn region tfParent matchgroup=Delimiter start="\[" end="\]" contains=ALL
  142. syn region tfParent matchgroup=Delimiter start="{" end="}" contains=ALL
  143.  
  144. syn match tfEndCommand "%%\{-};"
  145. syn match tfJoinLines "\\$"
  146.  
  147. " Types
  148.  
  149. syn match tfType "/[a-zA-Z_~@][a-zA-Z0-9_]*" contains=tfConditional,tfRepeat,tfStatement,tfInclude,tfDefine,tfStatement
  150.  
  151. " Catch /quote .. '
  152. syn match tfQuotes "/quote .\{-}'" contains=ALLBUT,tfString
  153. " Catch $(/escape   )
  154. syn match tfEscape "(/escape .*)"
  155.  
  156. " sync
  157. if exists("tf_minlines")
  158.   exec "syn sync minlines=" . tf_minlines
  159. else
  160.   syn sync minlines=100
  161. endif
  162.  
  163. " Define the default highlighting.
  164. " For version 5.7 and earlier: only when not done already
  165. " For version 5.8 and later: only when an item doesn't have highlighting yet
  166. if version >= 508 || !exists("did_tf_syn_inits")
  167.   if version < 508
  168.     let did_tf_syn_inits = 1
  169.     command -nargs=+ HiLink hi link <args>
  170.   else
  171.     command -nargs=+ HiLink hi def link <args>
  172.   endif
  173.  
  174.   HiLink tfComment        Comment
  175.   HiLink tfString        String
  176.   HiLink tfNumber        Number
  177.   HiLink tfFloat        Float
  178.   HiLink tfIdentifier        Identifier
  179.   HiLink tfVar            Identifier
  180.   HiLink tfWorld        Identifier
  181.   HiLink tfReadonly        Identifier
  182.   HiLink tfHook        Identifier
  183.   HiLink tfFunctions        Function
  184.   HiLink tfRepeat        Repeat
  185.   HiLink tfConditional        Conditional
  186.   HiLink tfLabel        Label
  187.   HiLink tfStatement        Statement
  188.   HiLink tfType        Type
  189.   HiLink tfInclude        Include
  190.   HiLink tfDefine        Define
  191.   HiLink tfSpecialChar        SpecialChar
  192.   HiLink tfSpecialCharEsc    SpecialChar
  193.   HiLink tfParentError        Error
  194.   HiLink tfTodo        Todo
  195.   HiLink tfEndCommand        Delimiter
  196.   HiLink tfJoinLines        Delimiter
  197.   HiLink tfOperator        Operator
  198.   HiLink tfRelation        Operator
  199.  
  200.   delcommand HiLink
  201. endif
  202.  
  203. let b:current_syntax = "tf"
  204.  
  205. if main_syntax == 'tf'
  206.   unlet main_syntax
  207. endif
  208.  
  209. " vim: ts=8
  210.